1. Field of the Invention
The invention relates to memories, and more particularly to flash memories.
2. Description of the Related Art
A memory device, such as a memory card, stores data for a host. A memory device usually comprises a controller and at least one memory. The controller operates as a data access interface between the host and the memory card. When the host wants to access the memory, the host sends an access command to the controller. When the controller receives the access command from the host, the controller processes the access command and delivers the processed access command to the memory to drive the memory to perform operations requested by the access command.
Ordinarily, the controller converts a logical address of the access command to a physical address and then delivers the access command and the physical address to the memory. When the host sends a series of write commands to write data to a plurality of logical address ranges, and the logical address ranges corresponding to the write commands are overlapping with each other, the controller still sequentially sends the write commands to the memory without combining the write commands together. Overlapping segments of the logical address ranges are therefore repeatedly written to with data, leading to inefficient use of system resources. In addition, because pages of a flash memory cannot be written again before data stored in the pages are removed, when data of a subsequent write command are written to the pages corresponding to the overlapping segments of the logical address ranges, the controller must spend additional time to remove previously stored data of a prior write command from the pages; thus, causing a delay in processing of the write commands and degrading the performance of the memory device. A data access method is therefore required, which combines a plurality of write commands with overlapping logical address ranges; thus, improving system performance.
In addition, when the memory is a flash memory, data cannot be twice written to a page of a block of the memory. After previously stored data in all pages of the block is cleared at the same time, data can be written to the page again. When a controller continues to write a small amount of data to a specific page of the memory, the controller must repeatedly clear data stored in the block containing the specific page; thus, causing a delay in processing of write commands sent from the host and degrading the performance of the memory device. For example, the host may frequently write amended data of a file allocation table to a specific page storing the file allocation table. A data access method is therefore required to combine a plurality of write commands accessing a specific page of a memory; thus, improving system performance.